package com.lkm.app_ui.m.Imple.hsj522;

import android.os.Looper;

import com.lkm.app_ui.AppConst;
import com.lkm.app_ui.MyApplication;
import com.lkm.app_ui.m.nfc.OnNFCModuleStateEvent;
import com.lkm.comlib.Config;
import com.lkm.comlib.task2.DefaultTaskExecutor;
import com.lkm.frame.task.ProgressData;
import com.lkm.frame.task2.Task;
import com.lkm.hardware_connect.AbsOnDeviceStateEvent;
import com.lkm.hardware_connect.IHardwareControler;
import com.lkm.serialport_com.connect.SerialportConnectModule;
import com.lkm.serialport_common_com.connect.SerialportConfig;



public class CardCircuitComSe extends SerialportConnectModule implements ICardCircuitCom{


    public CardCircuitComSe() {
        super(MyApplication.getInstance().getTaskManager2(), Looper.getMainLooper(), Config.getTaskExecutor());
    }

    @Override
    protected SerialportConfig configSerialportConfig() {
        SerialportConfig serialportConfig = new SerialportConfig();
        serialportConfig.setDevName("/dev/ttyS2");
        serialportConfig.setBaud(115200);
        return serialportConfig;
    }




    @Override
    protected Task<IHardwareControler, ?, ?> createReadTask(IHardwareControler hardwareControler) {
        return new ReadTask(this, new DefaultTaskExecutor(AppConst.getTaskExecutor(), true), AppConst.getTaskManager2());
    }


    @Override
    protected AbsOnDeviceStateEvent createOnDeviceStateEvent(int state, int reConnectCount, boolean isError, String errorLog) {
        return new OnNFCModuleStateEvent(state, reConnectCount, isError, errorLog);
    }




}
